/*
 * Copyright (C) 2013 TopCoder Inc., All Rights Reserved.
 */
package cn.itcast.heima;

/**
 * @author TCSASSEMBLER
 * @version 1.0 ()
 * @since 1.0
 */
public class TraditionalThread {
	
	public static void main(String[] args) {
		Thread thread = new Thread() {
			/* (non-Javadoc)
			 * @see java.lang.Thread#run()
			 */
			@Override
			public void run() {
				while(true) {
					System.out.println(Thread.currentThread().getName());
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
		};
		thread.start();
		
		Thread thread2 = new Thread(new Runnable() {
			
			@Override
			public void run() {
				while(true) {
					System.out.println(Thread.currentThread().getName());
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
		});
		thread2.start();
		
		new Thread(
			new Runnable() {
				
				@Override
				public void run() {
					while (true) {
						System.out.println("runnable:" +Thread.currentThread().getName());
						try {
							Thread.sleep(1000);
						} catch (InterruptedException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				}
			}
		) {
			public void run() {
				while (true) {
					System.out.println("Thread:" +Thread.currentThread().getName());
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			};
		}.start();
	}
	
	
	
	
}
